package com.gamex.findit.battle;

import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.springframework.beans.factory.annotation.Autowired;

import com.gamex.findit.service.BattleService;

public class ServerPipelineFactory implements ChannelPipelineFactory {

	@Autowired
	private BattleService battleService;
	
	public ServerPipelineFactory(BattleService battleService) {
		this.battleService =  battleService;

	}
	
	public ChannelPipeline getPipeline() throws Exception {
		ChannelPipeline pipeline = Channels.pipeline();
		pipeline.addLast("handler", new ServerHandler(battleService));
		return pipeline;
	}
}
